private["_position"];

if (isServer) then
{
	_siteAmount = round (5 + (random 5));

	format ["正在生成 %1 个坠机点...", _siteAmount] call AfterlifeServer_util_log;

	_worldCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");

	for "_i" from 1 to _siteAmount do
	{
		_validspot 	= false;
		while{!_validspot} do 
		{
			sleep 0.2;
			
			_safePosition = [_worldCenter,100,worldSize,10,0,0,0] call BIS_fnc_findSafePos;
			_position = [_safePosition select 0, _safePosition select 1, 0];
			_validspot	= true;
		
			_nearOtherCrash = (nearestObjects [_position,["Land_UWreck_MV22_F"],750]) select 0;	
			if (!isNil "_nearOtherCrash") then 
			{ 
				_validspot = false; 
			};
		};	
		
		format['第 %1 号坠机点在 %2 成功生成了',_i,_position] call AfterlifeServer_util_log;
		
		_helicopter = "Land_UWreck_MV22_F";
		_vehHeli = _helicopter createVehicle [0,0,0];
		
		_effect = "test_EmptyObjectForSmoke";

		_heliFire = _effect createVehicle (position _vehHeli);   
		_heliFire attachto [_vehHeli, [0,0,-1]];
		_vehHeli setPos _position;
	};
};

true